import request from '@/api/request'

const mockUrl = (path: string) => {
  return 'http://127.0.0.1:4523/m1/3058855-0-default' + path
}
const prefixUrl = (path: string) => {
  return '/api' + path
}
export const getActiveDevices = () => {
  const url = prefixUrl('/api/activeDevices')
  return request.get(url)
}
export const userLogin = (data: any) => {
  const url = prefixUrl('/user/login')
  return request.post(url, data)
}

export const getHistoryHr = (params: any) => {
  const url = prefixUrl('/api/history/hr')
  return request.get(url, {params})
}

export const getHistorySpo2 = (params: any) => {
  const url = prefixUrl('/api/history/spo2')
  return request.get(url, {params})
}
export const getHistoryResp = (params: any) => {
  const url = prefixUrl('/api/history/resp')
  return request.get(url, {params})
}
export const getHistoryNibp = (params: any) => {
  const url = prefixUrl('/api/history/nibp')
  return request.get(url, {params})
}
export const getHistoryTemp = (params: any) => {
  const url = prefixUrl('/api/history/temp')
  return request.get(url, {params})
}